﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Resto.CostControl.Core.Cache;
using Resto.CostControl.Core.Domain.Model;

namespace Resto.CostControl.Core.Facade.SiteModule.DataTransferObject
{
    /// <summary>
    /// 销售方式
    /// </summary>
    public class SalesMethodDTO
    {
        #region 基本属性



        public string ID { get; set; }

        /// <summary>
        /// 销售方式的类型，该类型没有枚举，通过字典或者用户自己填
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 收入
        /// </summary>
        public decimal Amount { get; set; }

        #endregion

        #region 构造函数

        public SalesMethodDTO() { }

        internal SalesMethodDTO(SalesMethod item)
        {
            this.ID = item.ID;
            this.Type = item.Type;
            this.Amount = item.Amount;
        }

        #endregion


        #region 方法

        internal SalesMethod ToSalesMethod()
        {
            SalesMethod item = new SalesMethod();
            CopyToSalesMethod(item);
            return item;
        }

        internal void CopyToSalesMethod(SalesMethod item)
        {
            item.Type = this.Type;
            item.Amount = this.Amount;
        }

        #endregion
    }
}
